<!DOCTYPE html>
<!--suppress BadExpressionStatementJS, UnterminatedStatementJS -->
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>

    <script type="text/javascript" charset="utf-8" src="/ueditor/ueditor.config.js"></script>
    <script type="text/javascript" charset="utf-8" src="/ueditor/ueditor.all.min.js"></script>
    <script type="text/javascript" charset="utf-8" src="/ueditor/lang/zh-cn/zh-cn.js"></script>
    <script type="text/javascript" src="/test/js/jquery/jquery-2.2.4.js"></script>
    <script type="text/javascript">
        $(function () {

            $("#Z").click(function (event) {
                event.preventDefault();
                var mobile = $("#Zmobile").val(),
                        password = $("#Zpassword").val();
                var url = "/user/login";
                $.post(url, {
                    mobile: mobile,
                    password: password
                }, function (result) {
                    alert("aaaaaa");
                    if (result.status === 1)
                        alert("登录成功");
                    else alert("登陆失败");
//                    window.location.href = "/index.html";
                    alert(JSON.stringify(result));
                })
            });

            $("#A").click(function (event) {
                event.preventDefault();
                var mobile = $("#Amobile").val(), verificationCode = $("#AverificationCode").val(),
                        password = $("#Apassword").val();
                var url = "/user/register";
                $.post(url, {
                    mobile: mobile,
                    verificationCode: verificationCode,
                    password: password
                }, function (result) {
                    if (result.status === 1) {
                        alert("注册成功");
                    }
                    else alert("注册失败");
//                    window.location.href = "/index.html";
                    alert(JSON.stringify(result));
                })
            });

            $("#B").click(function (event) {
                event.preventDefault();
                var mobile = $("#Bmobile").val(), verificationType = $("#BverificationType").val();
                var url = "/user/verification";
                $.post(url, {mobile: mobile, verificationType: verificationType}, function (result) {
                    alert(JSON.stringify(result));
                    if (result.status === 1) {
                        alert("获取成功!!");
                    }
                })
            });
            $("#C").click(function (event) {
                event.preventDefault();
                var url = "/admin/news/save";
                var title = $("#Ctitle").val(), introduction = $("#Cintroduction").val(),
                        label = $("#Clabel").val(), author = $("#Cauthor").val(), publicTime = $("#CpublishTime").val(),
                        content = UE.getEditor('Ccontent').getContent();
                $.post(url, {
                    title: title,
                    introduction: introduction,
                    label: label,
                    author: author,
                    publicTime: publicTime,
                    content: content
                }, function (result) {
                    alert(JSON.stringify(result));
                })
            });

            $("#D").click(function (event) {
                event.preventDefault();
                var url = "/news/detail";
                var id = $("#DnewsId").val();
                $.post(url, {id: id}, function (result) {
                    alert(JSON.stringify(result));
                })
            });

            $("#E").click(function (event) {
                event.preventDefault();
                var url = "/admin/news/delete";
                var id = $("#EnewsId").val();
                $.post(url, {id: id}, function (result) {
                    alert(JSON.stringify(result));
                })
            });

            $("#F").click(function (event) {
                event.preventDefault();
                var url = "/news/page";
                var title = $("#Ftitle").val(), label = $("#Flabel").val(), author = $("#Fauthor").val(),
                        pageSize = $("#FpageSize").val(), pageNo = $("#FpageNo").val();
//                alert(pageSize);
                $.post(url, {
                    title: title,
                    label: label,
                    author: author,
                    pageSize: pageSize,
                    pageNo: pageNo
                }, function (result) {
                    alert(JSON.stringify(result));
                })
            });
            $("#G").click(function (event) {
                event.preventDefault();
                var url = "/user/edit";
                var password = $("#Gpassword").val();
                var nickName= $("#GnickName").val();
                var header = $("#Gheader").val();
                var gender = $("#Ggender").val();
                var email = $("#Gemail").val();
                var qq = $("#Gqq").val();
                var weixin = $("#Gweixin").val();
                var parentMobile = $("#GparentMobile").val();
                var studentId = $("#GstudentId").val();

                $.post(url, {
                    password: password,
                    nickName: nickName,
                    header: header,
                    gender: gender,
                    email: email,
                    qq: qq,
                    weixin: weixin,
                    parentMobile: parentMobile,
                    studentId: studentId
                }, function (result) {
                    alert(JSON.stringify(result));
                })
            });


            $("#H").click(function (event) {
                event.preventDefault();
                var url = "/admin/user/manager";
                var password = $("#Hpassword").val();
                var nickName= $("#HnickName").val();
                var header = $("#Hheader").val();
                var gender = $("#Hgender").val();
                var email = $("#Hemail").val();
                var qq = $("#Hqq").val();
                var weixin = $("#Hweixin").val();
                var parentMobile = $("#HparentMobile").val();
                var studentId = $("#HstudentId").val();

                $.post(url, {
                    password: password,
                    nickName: nickName,
                    header: header,
                    gender: gender,
                    email: email,
                    qq: qq,
                    weixin: weixin,
                    parentMobile: parentMobile,
                    studentId: studentId
                }, function (result) {
                    alert(JSON.stringify(result));
                })
            });


            $("#I").click(function (event) {
                event.preventDefault();
                var url = "/admin/user/page";
                var nickName = $("#InickName").val(), mobile = $("#Imobile").val(),
                        pageSize = $("#IpageSize").val(), pageNo = $("#IpageNo").val();
//                alert(pageSize);
                $.post(url, {
                    nickName: nickName,
                    mobile: mobile,
                    pageSize: pageSize,
                    pageNo: pageNo
                }, function (result) {
                    alert(JSON.stringify(result));
                })
            });


            $("#J").click(function (event) {
                event.preventDefault();
                var url = "/admin/user/delete";
                var id = $("#Jid").val();
                $.post(url, {id: id}, function (result) {
                    alert(JSON.stringify(result));
                })
            });
        })
    </script>

    <script type="text/javascript">
        $(function () {
            var editor_a = UE.getEditor('Ccontent', {initialFrameHeight: 500});
        })

    </script>
</head>
<body>


<h3>用户登录</h3>
<input id="Zmobile" placeholder="手机号" type="text">
<input id="Zpassword" placeholder="密码" type="text">
<button id="Z">用户登录</button>
<hr>

<h3>用户注册</h3>
<input id="Amobile" placeholder="手机号" type="text">
<input id="AverificationCode" placeholder="验证码" type="text">
<input id="Apassword" placeholder="密码" type="text">
<button id="A">用户注册</button>
<hr>
<hr>
<h3>获取验证码</h3>
<input id="Bmobile" placeholder="手机号" type="text">
<input id="BverificationType" placeholder="验证码类型" type="text">
<button id="B">获取验证码</button>
<hr>
<br><br>
<h3>学员信息编辑</h3>
<input id="Gpassword" placeholder="密码" type="text">
<input id="GnickName" placeholder="用户名" type="text">
<input id="Gheader" placeholder="头像需要先调用上传接口，或者使用jquery.uploadify.min.js里面的" type="text">
<input id="Ggender" placeholder="性别  男或女"  type="text">
<input id="Gemail" placeholder="邮箱"  type="text">
<input id="Gqq" placeholder="qq"  type="text">
<input id="Gweixin" placeholder="微信"  type="text">
<input id="GparentMobile" placeholder="家长电话"  type="text">
<input id="GstudentId" placeholder="学号"  type="text">
<button id="G">学员信息编辑</button>
<hr>
<br><br>
<h3>管理学员信息</h3>
<input id="Hpassword" placeholder="密码" type="text">
<input id="HnickName" placeholder="用户名" type="text">
<input id="Hheader" placeholder="头像需要先调用上传接口，或者使用jquery.uploadify.min.js里面的" type="text">
<input id="Hgender" placeholder="性别  男或女"  type="text">
<input id="Hemail" placeholder="邮箱"  type="text">
<input id="Hqq" placeholder="qq"  type="text">
<input id="Hweixin" placeholder="微信"  type="text">
<input id="HparentMobile" placeholder="家长电话"  type="text">
<input id="HstudentId" placeholder="学号"  type="text">
<button id="H">管理学员信息</button>

<hr>
<br><br>
<h3>学员信息列表</h3>
<input id="InickName" placeholder="用户名" type="text">
<input id="Imobile" placeholder="手机号" type="text">

<input id="IpageSize" type="text" placeholder="分页大小">
<input id="IpageNo" type="text" placeholder="页码">
<button id="I">学员信息列表</button>

<hr>
<br><br>
<h3>学员信息删除</h3>
<input id="Jid" placeholder="用户id" type="text">

<button id="J">学员信息删除</button>

<hr>
<h3>保存新闻</h3>
<input id="Ctitle" placeholder="标题" type="text">
<input id="Cintroduction" placeholder="简介" type="text">
<input id="Clabel" placeholder="标签" type="text">
<input id="Cauthor" placeholder="作者" type="text">

<input id="CpublishTime" placeholder="发布时间" type="text">
<button id="C">保存新闻</button>
<div>
    <script id="Ccontent" type="text/plain" style="width:1024px;height:500px;">啦啦啦啦啦</script>
</div>


<hr>
<h3>查看新闻</h3>
<input id="DnewsId" placeholder="新闻Id" type="text">
<button id="D">查看新闻</button>

<hr>
<br><br>
<h3>删除新闻</h3>
<input id="EnewsId" placeholder="新闻Id" type="text">
<button id="E">删除新闻</button>

<hr>
<br><br>
<h3>新闻列表</h3>
<input id="Ftitle" type="text" placeholder="标题">
<input id="Flabel" type="text" placeholder="标签">
<input id="Fauthor" type="text" placeholder="作者">
<input id="FpageSize" type="text" placeholder="分页大小">
<input id="FpageNo" type="text" placeholder="页码">
<button id="F">查询新闻列表</button>
</body>
</html>